package com.wisdom.sms.net.http;

public class SmsServiceProxy implements com.wisdom.sms.net.http.SmsService {
  private String _endpoint = null;
  private com.wisdom.sms.net.http.SmsService smsService = null;
  
  public SmsServiceProxy() {
    _initSmsServiceProxy();
  }
  
  public SmsServiceProxy(String endpoint) {
    _endpoint = endpoint;
    _initSmsServiceProxy();
  }
  
  private void _initSmsServiceProxy() {
    try {
      smsService = (new com.wisdom.sms.net.http.SmsServiceServiceLocator()).getSmsService();
      if (smsService != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)smsService)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)smsService)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (smsService != null)
      ((javax.xml.rpc.Stub)smsService)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public com.wisdom.sms.net.http.SmsService getSmsService() {
    if (smsService == null)
      _initSmsServiceProxy();
    return smsService;
  }
  
  public com.wisdom.sms.net.http.Response createActivitySpreadTask(java.lang.String userName, java.lang.String password, com.wisdom.sms.net.messages.SpreadTask spreakTask) throws java.rmi.RemoteException{
    if (smsService == null)
      _initSmsServiceProxy();
    return smsService.createActivitySpreadTask(userName, password, spreakTask);
  }
  
  public com.wisdom.sms.net.http.Response sendSMS(java.lang.String userName, java.lang.String password, com.wisdom.sms.net.messages.SmsMessages msgs) throws java.rmi.RemoteException{
    if (smsService == null)
      _initSmsServiceProxy();
    return smsService.sendSMS(userName, password, msgs);
  }
  
  
}